<template>
	<view class="uni_box home">
		<navbar :title='title'>
		</navbar>
		<view class="content">
			<u-parse :html="content" :tag-style="style"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:'',
				style: {
						img: 'width:max-width:100%;height:auto;pointer-events: none;'
				},
				type:'',
				setting:{
					content:''
				},
				title:''
			}
		},
		onLoad(option) {
			this.type = option.type
			// if(this.type == 'privacy'){
			// 	this.title = '隐私协议'
			// }else if(this.type == 'agreement'){
			// 	this.title = '用户协议'
			// }else if(this.type == 'xuexi'){
			// 	this.title = '学习'
			// }
			this.getxieyi()
		},
		onShow() {
		},
		methods: {
			async getxieyi(){
				// let codetit = ''
				// if(this.type == 'xuexi'){
				// 	codetit = 'study'
				// }
				let res = await this.$u.api.getContent({
					code:this.type
				});
				this.title = res.title
				this.content = res.content
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fff;
	}
	.content{
		background-color: #fff;
		padding: 30rpx;
		font-family: PingFang SC;
		font-weight: 400;
		font-size: 28rpx;
		color: #666666;

	}
</style>
